package com.castile.secondkill.service.model;

import java.math.BigDecimal;

/**
 * 用户下单的交易模型
 * 考虑一种最简单的场景： 用户一次下单，只购买一种商品，并且支付了一次费用
 *
 * @author Hongliang Zhu
 * @create 2023-03-18 21:37
 */
public class OrderModel {

    // 交易号
    // 202012221001234
    private String id;

    // 用户id
    private Integer userId;

    // 商品id
    private Integer itemId;


    // 如果非空，则表示是以秒杀的方式进行下单
    private Integer promoId;

    // 购买的数量
    private Integer amount;

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getPromoId() {
        return promoId;
    }

    public void setPromoId(Integer promoId) {
        this.promoId = promoId;
    }

    //如果primoId非空，则表示是以秒杀的价格
    private BigDecimal itemPrice;


    // 购买金额
    //如果primoId非空，则表示是以秒杀的价格
    private BigDecimal orderPrice;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }


    public BigDecimal getItemPrice() {
        return itemPrice;
    }

    public void setItemPrice(BigDecimal itemPrice) {
        this.itemPrice = itemPrice;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }
}
